// created by noellynch
// Jun 3, 2009

package com.sceneworker.jmetreeextensions;

import java.util.Vector;

import com.acarter.composabletree.ComposableTreeNode;
import com.acarter.jmejtree.JMEComposableTreeModel;
import com.acarter.jmejtree.treenode.CollisionGeometryTreeNode;
import com.acarter.jmejtree.treenode.DynamicPhysicsNodeTreeNode;
import com.acarter.jmejtree.treenode.StaticPhysicsNodeTreeNode;
import com.jme.scene.Controller;
import com.jme.scene.Spatial;
import com.jme.scene.state.RenderState;

public class SceneWorkerPhysicsTreeModel extends SceneWorkerComposableTreeModel {

	/**
	 * @param root
	 */
	public SceneWorkerPhysicsTreeModel(Object root) {
		super(root);

		// These were just added by super(root)
		ComposableTreeNode spatial = getNodeType(Spatial.class);
		ComposableTreeNode renderstate = getNodeType(RenderState.class);
		ComposableTreeNode controller = getNodeType(Controller.class);
		
		// Adding physics tree nodes
		StaticPhysicsNodeTreeNode staticPhysicsNode = new StaticPhysicsNodeTreeNode();
		DynamicPhysicsNodeTreeNode dynamicPhysicsNode = new DynamicPhysicsNodeTreeNode();
		CollisionGeometryTreeNode collisionGeometry = new CollisionGeometryTreeNode();
		
		Vector<ComposableTreeNode> physicsNodeChildren = new Vector<ComposableTreeNode>();
		physicsNodeChildren.add(renderstate);
		physicsNodeChildren.add(controller);
		physicsNodeChildren.add(spatial);

		addNodeType(staticPhysicsNode, physicsNodeChildren);
		addNodeType(dynamicPhysicsNode, physicsNodeChildren);
		addNodeType(collisionGeometry, new Vector<ComposableTreeNode>());
	}

}
